import { useEffect } from "react"

/** 挂载时执行
 * @example
 *
 * ```tsx
 * useMount(() => {
 *   console.log('dom初始化挂载完成！')
 * }
 * ```
 */
export default (fn: () => void) => {
  useEffect(() => {
    fn?.();
  }, [])
}
